package com.example.demo.service.impl;

import com.example.demo.anno.AutoCustomAnnotation;
import com.example.demo.entity.Role;
import com.example.demo.mapper.RoleMapper;
import com.example.demo.service.IRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 角色 服务实现类
 * </p>
 *
 * @author Mr.Abel
 * @since 2024-03-27
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @AutoCustomAnnotation(ttl = 2592000,group = "user:role:")
    @Override
    public List<String> selectUserRoleById(Integer id) {
        return getBaseMapper().selectUserRoleById(id);
    }

    @AutoCustomAnnotation(ttl = 2592000,group = "user:permission:")
    @Override
    public List<String> selectUserPermissionsById(Integer id) {
        return getBaseMapper().selectUserPermissionsById(id);
    }
}
